<template>
	<div>
		<div class="kucun_detail_wrap">
			<el-row :gutter="20">
				<el-col v-if="backReason" :span="6">
					<div class="grid-content bg-purple">
						问题类型：
						<span style="color: #DD6161;">
							{{backReason}}
						</span>
					</div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple">
						运单号：{{waybillNumber}}
					</div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple">
						快递公司：{{expressCompanyName}}
					</div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple">
						入库时间：{{date}}
					</div>
				</el-col>
			</el-row>
			<el-row :gutter="20">
				<el-col :span="6">
					<div class="grid-content bg-purple">
						客户电话：{{clientMobile}}
					</div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple">
						在库时长： {{storeDay}}
					</div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple">
						通知状态：{{notifyStatusText}}
					</div>
				</el-col>
				<el-col v-if='signDate' :span="6">
					<div class="grid-content bg-purple">
						签收时间：{{signDate}}
					</div>
				</el-col>
			</el-row>
			<el-row :gutter="20">
				<el-col v-if="backDate" :span="6">
					<div class="grid-content bg-purple">
						退件时间：
						<span style="color: #DD6161;">
							{{backDate}}
						</span>
					</div>
				</el-col>
			</el-row>
		</div>
	</div>
</template>
<script>
	import http from '@/assets/js/http.js'
	
	export default {
		data() {
			return {
				backReason: '', //问题类型(退件才有)
				backDate: '', //退件时间(退回件才有）
				waybillNumber: '', //运单号
				expressCompanyName: '', //快递公司名称
				date: '', //入库时间
				clientMobile: '', //客户电话
				storeDay: '', //在库时长
				notifyStatus: '', //通知状态 1公众号通知 2发送成功 3发送中 4发送失败 5待发送
				notifyStatusText: '',
				signDate: '', //签收时间(签收件才有)
			}
		},
		created() {
			let that = this;
			let row = that.$route.query.row
			this.apiGet("/api/backend/site/storck/detail?storckId=" + row.storckId).then(res => {
				if(res.code == 200) {
					//通知状态
					switch(res.data.notifyStatus) {
						case 1:
							that.notifyStatusText = '公众号通知'
							break;
						case 2:
							that.notifyStatusText = '发送成功'
							break;
						case 3:
							that.notifyStatusText = '发送中'
							break;
						case 4:
							that.notifyStatusText = '发送失败'
							break;
						case 5:
							that.notifyStatusText = '待发送'
							break;
						default:
							break;
					}
					that.backReason = res.data.backReason
					that.backDate = res.data.backDate
					that.waybillNumber = res.data.waybillNumber
					that.expressCompanyName = res.data.expressCompanyName
					that.date = res.data.date
					that.clientMobile = res.data.clientMobile
					that.storeDay = res.data.storeDay
					that.signDate = res.data.signDate
				}
			})
		},
		mixins: [http]
		
	}
</script>
<style scoped>
	.kucun_detail_wrap {
		background: #fff;
		padding: 20px;
		border-radius: 6px;
	}
	
	.el-row {
		line-height: 40px;
		font-size: 14px;
	}
</style>